#include "FileSys.h"
#include <Arduino.h>
#include <SPIFFS.h>

void initSPIFFS(){
    // 初始化 SPIFFS
    if (!SPIFFS.begin(true)) {
        Serial.println("An error occurred while mounting SPIFFS");
        return;
    }
}

void getUseAbleSpace(){
    // 获取文件系统的总空间和剩余空间
    uint32_t totalBytes = SPIFFS.totalBytes();
    uint32_t usedBytes = SPIFFS.usedBytes();
    uint32_t freeBytes = totalBytes - usedBytes;

    Serial.print("Total space: ");
    Serial.print(totalBytes);
    Serial.println(" bytes");

    Serial.print("Used space: ");
    Serial.print(usedBytes);
    Serial.println(" bytes");

    Serial.print("Free space: ");
    Serial.print(freeBytes);
    Serial.println(" bytes");
}